public class Driver {
  PeriodicTable tbl;
  MainMenu menu;
  String current;

  public Driver() {
    menu = new MainMenu();
    current = "MENU";
  }

  public void mouseDriver(float x, float y) {
    if (current.equals("MENU")) {
      menu.mouseAct(x, y);
      if (menu.switchTo.equals("Physics")) {
        current = "PHYS-MENU";
      }
      if (menu.switchTo.equals("Chemistry")) {
        tbl = new PeriodicTable();
        current = "PTABLE";
      }
      if (menu.switchTo.equals("Math")) {
        current = "MATH-MENU";
      }
      if (menu.switchTo.equals("English")) {
        current = "ENG-MENU";
      }
      if (menu.switchTo.equals("Biology")) {
        current = "BIO-MENU";
      }
      if (menu.switchTo.equals("History")) {
        current = "HIST-MENU";
      }
      return;
    }
    if (current.equals("PTABLE")) {
      tbl.mouseAct(x, y);
    }
  }

  public void keyboardDriver() {
    tbl.keyboardAct();
  }
}

